StupidBeauty
Read times:640Posted at:Mon May 27 22:24:02 2013
- no title specified

转载:Cocos2dx 学习笔记(1) ---- Hello Lua!

安卓系统中,使用cocos2d-x开发的游戏,在系统有电话来了时,会触发AppDelegate::applicationDidEnterBackground()函数。可在这个函数里作些必要的处理,例如暂停游戏。

http://www.cnblogs.com/KevinYuen/archive/2013/03/10/2952915.html

亮点:

// 当应用程序后台化后,比如来电话也会是这个效果,那么这里的操作是:

void AppDelegate::applicationDidEnterBackground()

{

// 终止所有动画的播放,cocos2dx的操作为不进行场景渲染

CCDirector::sharedDirector()->stopAnimation();

// 背景音乐暂停

SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic();

}

// 当应用程序重新回到前台,一切恢复

void AppDelegate::applicationWillEnterForeground()

{

// 渲染场景

CCDirector::sharedDirector()->startAnimation();

// 背景音乐恢复播放

SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic();

}

英拉

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4